// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';

// 定义 API 路径枚举
enum Api {
    SysMenuAdd = '/SysMenu/AddMenu',
    SysMenuDelete = '/SysMenu/DeleteMenu',
    SysMenuUpdate = '/SysMenu/UpdateMenu',
    SysMenuList = '/SysMenu/list',
    SysMenuLoginMenuTree = '/SysMenu/loginMenuTree',
    SysMenuOwnBtnPermList = '/SysMenu/ownBtnPermList',
}

// 定义 API 方法
export const apiSysMenuAddPost = (body: any) =>
    request({
        url: Api.SysMenuAdd,
        method: 'post',
        data: body,
    });

export const apiSysMenuDeletePost = (body: any) =>
    request({
        url: Api.SysMenuDelete,
        method: 'delete',
        data: body,
    });

export const apiSysMenuListGet = (title?: string, type?: number, tenantId?: number) =>
    request({
        url: Api.SysMenuList,
        method: 'get',
        params: {
            Title: title,
            Type: type,
            TenantId: tenantId,
        },
    });

export const apiSysMenuLoginMenuTreeGet = () =>
    request({
        url: Api.SysMenuLoginMenuTree,
        method: 'get',
    });

export const apiSysMenuOwnBtnPermListGet = () =>
    request({
        url: Api.SysMenuOwnBtnPermList,
        method: 'get',
    });

export const apiSysMenuUpdatePost = (body: any) =>
    request({
        url: Api.SysMenuUpdate,
        method: 'put',
        data: body,
    });